Information on orientations in digital images are of interest to obtain for various reasons. It may e.g. be of particular interest to be able to get information about dominating orientations in an automated way in order to use it in connection with machine vision, such as in automated inspection systems. Reasons may for example relate to reading and/or classification of codes, such as bar codes or so called smart codes. Based on knowledge of one or more dominating orientations in the an image depicting the code, a code reader and/or object can e.g. be positioned in a needed or improved position for reading the code, e.g. for more accurate and/or faster reading than else would be possible. Bar codes are examples of codes where information is coded in one or more directions, e.g. in one direction in 1-dimensional (1D) codes and in two directions in 2-dimensional (2D) codes. The most common conventional barcodes are 1D barcodes. So called smart codes, e.g. QUICK RESPONSE, or QR, codes are examples of 2D barcodes. There are also other codes that are based on that information is coded in one or more directions, or dimensions.
Not only codes have dominating directions of interest to obtain information about. In fact any label with information, such as text and/or other print typically have one or two dominating orientations. This is also true for in principle any object and image thereof, e.g. an image depicting a rectangular object typically has two dominating orientations orthogonal to the edges of the rectangular shape. Getting fast and accurate information of orientations may facilitate further handling, such as reading information on, griping and/or positioning of an object etc.
U.S. Pat. No. 7,876,933 B2 discloses methods and apparatuses for estimating orientation in an image, in particular with regard to a fingerprint image. The solution is based on measuring gradients and orientations of pixels, then quantize the measured orientations, corresponding to forming a histogram, and thereafter determine a representative, or dominating, orientation as an orientation having maximum histogram value in relation to quantized orientations.